#include <cstdlib>
#include <string>
#include <iostream>
#include <vector>
#include <climits>

using namespace std;


struct TreeNode {
    int val;
    TreeNode *left;
    TreeNode *right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

class Solution {
public:
	bool hasPathSum(TreeNode *root, int sum) {
		if (root == NULL) return false;
		TreeNode* leftChild = root->left;
		TreeNode* rightChild = root->right;
		if (sum == root->val && leftChild == NULL && rightChild == NULL) return true;
		return hasPathSum(leftChild, sum - root->val) || hasPathSum(rightChild, sum - root->val);
	}
};
int main(int argc, char argv){

	return 0;
}